﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Roles.aspx.cs" Inherits="MonkeyWarranty.Web.Employees.Roles" %>
<%@ Import Namespace="Resources" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <title>Phân quyền</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="row">
        <div class="col-lg-12">
            <h3>Phân quyền</h3>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div id="RolesTableContainer"></div>
        </div>
    </div>
    
    <script type="text/javascript">
        $(function() {
            $("#menu-user").addClass("active");
            $("#menu1-user").addClass("collapse in");
            $("#menu1-roles").addClass("active");

            $('#RolesTableContainer').jtable({
                title: '',
                actions: {
                    listAction: 'Roles.aspx/RolesList'
                },
                fields: {
                    Id: {
                        key: true,
                        create: false,
                        edit: false,
                        list: false
                    },
                    Name: {
                        title: '<%=GlobalStrings.Name %>',
                        width: '20%'
                    },
                    Description: {
                        title: '<%=GlobalStrings.Description %>',
                        width: '80%'
                    },
                    Users: {
                        title: '<%=GlobalStrings.Employees %>',
                        display: function(data) {
                            return '<a href="RoleEmployee.aspx?roleId=' + data.record.Id + '"><i class="fa fa-users fa-fw"></i></a>';
                        }
                    }
                }
            });

            $('#RolesTableContainer').jtable('load');
        });
    </script>
</asp:Content>
